package com.lan.model;

import org.antlr.v4.runtime.ParserRuleContext;

public class CompilationLog {

    private String message;

    private int line;

    private int positionInLine;

    // 相关的AST节点
    private ParserRuleContext ctx;

    // log的类型，包括信息、警告、错误。
    private int type = INFO;

    public static int INFO = 0;
    public static int WARNING = 1;
    public static int ERROR = 2;

    @Override
    public String toString() {
        return message + " @" + line + ":" + positionInLine;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getLine() {
        return line;
    }

    public void setLine(int line) {
        this.line = line;
    }

    public int getPositionInLine() {
        return positionInLine;
    }

    public void setPositionInLine(int positionInLine) {
        this.positionInLine = positionInLine;
    }

    public ParserRuleContext getCtx() {
        return ctx;
    }

    public void setCtx(ParserRuleContext ctx) {
        this.ctx = ctx;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }


}
